﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace BusinessObjects
{
    [DataContract]
    public class UserBadge : BaseBusinessObject
    {
        private string description;
        private bool isLocked = true;
        private string image;
        private string title;
        private BadgeTypes type;
        private int targetItems;
        private int currentItems = 0;
        private string requires;

        public string Description
        {
            get
            {
                return this.description;
            }
            set
            {
                if ( this.description == value )
                    return;

                this.description = value;
                this.NotifyPropertyChanged( "Description" );
            }
        }

        public bool IsLocked
        {
            get
            {
                return this.isLocked;
            }
            set
            {
                if ( this.isLocked == value )
                    return;

                this.isLocked = value;
                this.NotifyPropertyChanged( "IsLocked" );
            }
        }
        
        public string Image
        {
            get
            {
                return this.image;
            }
            set
            {
                if ( this.image == value )
                    return;

                this.image = value;
                this.NotifyPropertyChanged( "Image" );
            }
        }

        public string Title
        {
            get
            {
                return this.title;
            }
            set
            {
                if ( this.title == value )
                    return;

                this.title = value;
                this.NotifyPropertyChanged( "Title" );
            }
        }

        public BadgeTypes Type
        {
            get
            {
                return this.type;
            }
            set
            {
                if ( this.type == value )
                    return;

                this.type = value;
                this.NotifyPropertyChanged( "Type" );
            }
        }

        public int TargetItems
        {
            get
            {
                return this.targetItems;
            }
            set
            {
                if ( this.targetItems == value )
                    return;

                this.targetItems = value;
                this.NotifyPropertyChanged( "TargetItems" );
            }
        }

        public int CurrentItems
        {
            get
            {
                return this.currentItems;
            }
            set
            {
                if ( this.currentItems == value )
                    return;

                this.currentItems = value;
                this.NotifyPropertyChanged( "CurrentItems" );
            }
        }

        public int TypeId
        {
            get;
            set;
        }

        public string Requires
        {
            get
            {
                return this.requires;
            }
            set
            {
                if ( this.requires == value )
                    return;

                this.requires = value;
                this.NotifyPropertyChanged( "Requires" );
            }
        }

        public override object Clone()
        {
            UserBadge ubClone = new UserBadge() 
            {
                Description = this.Description,
                Image = this.Image,
                IsLocked = this.IsLocked,
                Title = this.Title,
                Type = this.Type,
                TargetItems = this.TargetItems,
                Requires = this.Requires
            };

            return ubClone;
        }
    }
}
